<?php
/* @var $this NavigationController */
/* @var $dataProvider CActiveDataProvider */
?>

<div class="row-fluid">
	<ul class="nav nav-pills">
	  <li class="active">
	    <a href="#">管理</a>
	  </li>
	  <li><a href="<?php echo $this->createUrl('navigation/create') ?>">添加</a></li>
	  
	</ul>
</div>
<div class="row-fluid">
  <div class="portlet box blue">

      <div class="portlet-title">

        <div class="caption"> <i class="icon-cogs"></i>
         导航
        </div>

      </div>
<div class="portlet-body">
	<table class="table table-bordered table-hover">
        <thead>
          <tr>
            <th>id</th>
            <th>名称</th>
            <th>排序</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($data->getData() as $item) {?>
            <tr>
              <td><?php echo $item->id ?></td>
              <td><a href="<?php echo $this->createUrl('navigation/Update',array("id"=>$item->id)) ?>" title="<?php echo $item->title ?>"><?php echo $item->title ?></a> </td>
              <td><?php echo $item->sort ?></td>
              <td>
                <a href="<?php echo $this->createUrl('navigation/Update',array("id"=>$item->id)) ?>" title="编辑"><i class="icon-edit"></i></a>&nbsp;&nbsp;
                <a href="<?php echo $this->createUrl('navigation/Delete',array("id"=>$item->id)) ?>" data-trigger="confirm" data-content='是否确定删除？' title="删除"><i class="icon-remove"></i></a>
              </td>
            </tr>
            <?php if(count($item->list)>0) {?>
            	<?php foreach ($item->list as $li) {?>
            			<tr>
			              <td><?php echo $li->id ?></td>
			              <td><a href="<?php echo $this->createUrl('navigation/Update',array("id"=>$li->id)) ?>" title="<?php echo $li->title ?>">|-----<?php echo $li->title ?></a> </td>
			              <td><?php echo $li->sort ?></td>
			              <td>
			                <a href="<?php echo $this->createUrl('navigation/Update',array("id"=>$li->id)) ?>" title="编辑"><i class="icon-edit"></i></a>&nbsp;&nbsp;
			                <a href="<?php echo $this->createUrl('navigation/Delete',array("id"=>$li->id)) ?>" data-trigger="confirm" data-content='是否确定删除？' title="删除"><i class="icon-remove"></i></a>
			              </td>
			            </tr>
            	<?php } ?>
            <?php } ?>
          <?php } ?>
        </tbody>
  </table>
<?php $this->widget("CBootstrapPager",array('pages'=>$data->getPagination())) ?>
</div>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/scojs/js/sco.modal.js" type="text/javascript" charset="utf-8" async defer></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/scojs/js/sco.confirm.js" type="text/javascript" charset="utf-8" async defer></script>
</div>
